/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gui;

import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.MouseEvent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.MouseInputAdapter;

/**
 *
 * @author LaurentPC
 */
public class SpecialPanel extends JPanel{
    public String niveau, structure;
    public String type;
    private SpecialPanel destroy;
    private final Board papa;
    private JLabel typeLabel;
    private JLabel niveauLabel;
    private JLabel structureLabel;
            
    
    public SpecialPanel(String type, String niveau, String structure, final Board papa) {
        Font f = new Font("Arial", Font.PLAIN, 20);
        this.type=type;
        this.niveau=niveau;
        this.structure=structure;
        this.setLayout(new GridLayout(1, 4));
        typeLabel = new JLabel(type.toString());
        this.add(typeLabel);
        JLabel niveauLabel = new JLabel(niveau);
        this.add(niveauLabel);
        structureLabel = new JLabel(structure);
        this.add(structureLabel);
        JLabel temp = new JLabel("");
        temp.setBackground(Color.black);
        this.add(temp);
        
        this.papa=papa;
        this.destroy=this;
        typeLabel.setForeground(Color.white);
        typeLabel.setHorizontalAlignment(SwingConstants.CENTER);
        typeLabel.setFont(new java.awt.Font("Arial", 0, 21));
        niveauLabel.setForeground(Color.white);
        niveauLabel.setHorizontalAlignment(SwingConstants.CENTER);
        niveauLabel.setFont(new java.awt.Font("Arial", 0, 21));
        structureLabel.setForeground(Color.white);
        structureLabel.setHorizontalAlignment(SwingConstants.CENTER);
        structureLabel.setFont(new java.awt.Font("Arial", 0, 21));
        this.setBackground(Color.black);
        this.addMouseListener(new MouseInputAdapter() {
          
            @Override
            public void mouseClicked(MouseEvent e) {
                if(e.getButton()==3) {
                    papa.removeExtraGros(destroy);
                }
            }
        });
    }

    public String getNiveau() {
        return niveau;
    }

    public String getStructure() {
        return structure;
    }

    public String getType() {
        return type;
    }  
    
}
